from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
from options import options
from service import service


# 打开论坛
url=r"http://192.168.4.6/upload"
dr=webdriver.Chrome(options=options,service=service)
dr.get(url)
dr.maximize_window()
sleep(3)
# 立即注册
dr.find_element(By.CSS_SELECTOR,'#lsform > div > div > table > tbody > tr:nth-child(2) > td:nth-child(4) > a').click()
sleep(3)
# 用户名输入
dr.find_element(By.ID,'Muc6WG').clear()
dr.find_element(By.ID,'Muc6WG').send_keys('lsls')
sleep(2)
# 密码输入
dr.find_element(By.ID,'WLYVuY').clear()
dr.find_element(By.ID,'WLYVuY').send_keys('123456')
sleep(2)
# 确认密码输入
dr.find_element(By.ID,'eakvBJ').clear()
dr.find_element(By.ID,'eakvBJ').send_keys('123456')
sleep(2)
# Email输入
dr.find_element(By.ID,'BQIr0s').clear()
dr.find_element(By.ID,'BQIr0s').send_keys('ls@qq.com')
sleep(2)
# 提交
dr.find_element(By.ID,'registerformsubmit').click()
sleep(2)
dr.quit()